package com.cn.rocketmq.controller;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/7/22
 */

@Component
@RocketMQMessageListener(topic = "jxsr", consumerGroup = "springboot_consumer_group")
public class ConsumerController implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        // 处理消息的逻辑
        System.out.println("Received message: " + message);
    }
}
